import socket
import datetime

HOST='0.0.0.0'
PORT=3434

s=socket.socket(socket.AF_INET,socket.SOCK_DGRAM)
s.bind((HOST,PORT))

while True:
    data,addr=s.recvfrom(1024)
    print("接收到来自%s的消息：%s"%(str(addr),str(data,encoding='utf-8')))
